package com.test.demo.controller;


import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.test.demo.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class HelloControler {


    @Value("${server.port}")
    String port;
    @Value("${test.user.id}")
    String id;
    @GetMapping(value = "/hi")
    public String hi(@RequestParam String name) {
        return "hello,"+name+",port"+port;
    }
    @GetMapping(value="/user")
    public String user() {
        return "hello,"+id;
    }
}